
import VueRouter from 'vue-router'

// 导入相对应的组件
// tabbar 的路由
import HomeContainer from './components/tabbar/home_container.vue'
import memberContainer from './components/tabbar/member_container.vue'
import shopCarContainer from './components/tabbar/shopcar_container.vue'
import searchContainer from './components/tabbar/search_container.vue'

// 首页中的路由 
import newsList from './components/news/newsList.vue'
import newsInfo from './components/news/newsInfo.vue'
import photoList from './components/photos/photoList.vue'
import photoInfo from './components/photos/photoinfo.vue'
import goodsList from './components/goods/goodList.vue'
import goodsInfo from './components/goods/goodsInfo.vue'

// 创建路由对象
var router = new VueRouter({
  routes: [ // 配置路由规则
    { path: '/', redirect: '/home' },
    { path: '/home', component: HomeContainer },
    { path: '/member', component: memberContainer },
    { path: '/shopcar', component: shopCarContainer },
    { path: '/search', component: searchContainer },
    { path: '/home/newsList', component: newsList },
    { path: '/home/newsInfo/:id', component: newsInfo },
    { path: '/home/photoList', component: photoList },
    { path: '/home/photoInfo/:id', component: photoInfo },
    { path: '/home/goodsList', component: goodsList },
    { path: '/home/goodsInfo/:id', component: goodsInfo, name: 'goodsInfo' }
  ],
  linkActiveClass: 'mui-active' // 覆盖默认的类 router-link-active
})

// 把路由对象暴露出去
export default router